import request from '@/config/axios'

// dispatch系统 商户 VO
export interface StoreAttendanceVO {
  id: number // 商户假期设置编号

  storeId: number
  dayWorkingTimeArray: string[] // 上班时间
  monthRestDays: number // 月休息时间
}

// dispatch系统 商户 API
export const StoreAttendanceApi = {
  // dispatch系统 商户分页
  getStoreAttendancePage: async (params: any) => {
    return await request.get({ url: `/dispatch/store-attendance/page`, params })
  },

  getStoreAttendanceList: async (id: number) => {
    return await request.get({ url: `/dispatch/store-attendance/list?id=` + id })
  },

  // dispatch系统 商户详情
  getStoreAttendance: async (id: number) => {
    return await request.get({ url: `/dispatch/store-attendance/get?id=` + id })
  },

  // 新增dispatch系统 商户
  createStoreAttendance: async (data: StoreAttendanceVO) => {
    return await request.post({ url: `/dispatch/store-attendance/create`, data })
  },

  // 修改dispatch系统 商户
  updateStoreAttendance: async (data: StoreAttendanceVO) => {
    return await request.put({ url: `/dispatch/store-attendance/update`, data })
  },

  // 删除dispatch系统 商户
  deleteStoreAttendance: async (id: number) => {
    return await request.delete({ url: `/dispatch/store-attendance/delete?id=` + id })
  },

  // 导出dispatch系统 商户 Excel
  exportStoreAttendance: async (params) => {
    return await request.download({ url: `/dispatch/store-attendance/export-excel`, params })
  },
}
